package exercises.Charpter8;

class Cycle{
	void action(){
		System.out.println("Cycle ride");
	}
	int wheels(){
		return 0;}
}

class Unicycle extends Cycle{
	@Override
	void action(){
		System.out.println("Unicycle ride");
	}
	@Override
	int wheels(){
		return 1;
	}
}

class Bicycle extends Cycle{
	@Override
	void action(){
		System.out.println("Bicycle ride");
	}
	@Override
	int wheels(){
		return 2;
	}
	void balance(){
		System.out.println("Bicycle Balanced.");
	}
}

class Tricycle extends Cycle{
	@Override
	void action(){
		System.out.println("Tricycle ride");
	}
	@Override
	int wheels(){
		return 3;
	}
	void balance(){
		System.out.println("Tricycle Balanced.");
	}
}

public class One {
	static void ride(Cycle me){
		me.action();
	}
	public static void main(String[] args){
		Cycle one = new Cycle();
		Unicycle two = new Unicycle();
		Bicycle three = new Bicycle();
		Tricycle four = new Tricycle();
		
		ride(one);
		ride(two);
		ride(three);
		ride(four);
	}
}
